<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <script>

        var person = {
            name: '小花',
            age: 16,
            sex: '女',
            say: function () {
                console.log('hello world');
            }
        }

        var car = {
            name : 'BWM' ,
            color : 'blue' ,
            price : '99999' ,
            run : ''
        }


        for(var key in person) {
            // key是变量，代表属性名
            // 访问变量的时候只能使用方括号语法
            console.log(key , obj[key]) ;
        }

    </script>

</body>

</html>